/**
 * This class is the main view for the application. It is specified in app.js as the
 * "mainView" property. That setting automatically applies the "viewport"
 * plugin causing this view to become the body element (i.e., the viewport).
 *
 * TODO - Replace this content of this view to suite the needs of your application.
 */
Ext.define('Jason.view.main.Main', {
    extend: 'Ext.container.Viewport',
    xtype: 'app-main',

    requires: [
        'Ext.plugin.Viewport',
        'Ext.list.Tree',
        'Ext.toolbar.Spacer',
        'Wys.pane.CardLayoutPanel',
        'Jason.view.main.MainContainerWrap',
        'Jason.store.NavigationTree',
        'Jason.view.main.MainController',
        'Jason.view.main.MainModel'
    ],
    layout: {
        type: 'vbox',
        align: 'stretch'
    },
    controller: 'main',
    viewModel: 'main',
    items:[{xtype: 'toolbar',
        cls: 'sencha-dash-dash-headerbar toolbar-btn-shadow',
        height: 38,
        itemId: 'headerBar',
        items: [{
            xtype: 'container',
            reference: 'senchaLogo',
            cls: 'sencha-logo',
            html: '<div class="main-logo">'+cfg.systemname+'</div>',
            width: 400
        },{
            xtype: 'tbspacer',flex: 1
        }/*,{
            cls: 'delete-focus-bg',
            iconCls:'x-fa fa-search',
            hrefTarget: '_self',
            ui:'btn-default-round',
            tooltip: '点击进行搜索'
        },{
            xtype: 'button',
            ui:'btn-default-round',
            iconCls: 'x-fa fa-slideshare',
            text: '切换系统'
        }*/]
    },{
        xtype: 'maincontainerwrap',
        id: 'main-view-detail-wrap',
        reference: 'mainContainerWrap',
        flex: 1,
        items: [
            {
                xtype: 'treelist',
                reference: 'navigationTreeList',
                itemId: 'navigationTreeList',
                ui: 'navigation',
                // store: {
                //     type : 'NavigationTree'
                // },
                // store:'leftMenu',
                width: 230,
                expanderFirst: false,
                expanderOnly: false,
                singleExpand: true,
                listeners: {
                    selectionchange: 'onNavigationTreeSelectionChange'
                }
            },{
                xtype: 'card-layout-panel',
                flex: 1,
                reference: 'mainCardPanel',
                cls:'overflow-visible-panel',
                itemId: 'contentPanel',
                layout: {
                    type: 'card',
                    anchor: '100%'
                }
            }
        ]
    },
    {
        xtype: 'component',
        itemId: 'globalToast',
        floating: true,
        y: 10,
        shadow: false,
        hideMode: 'offsets',
        cls: 'global-toast',
        showAnimation: 'slideIn',
        html: ''
    }]
});
